package com.fanfanwang.ffw.app.adapter;

import java.util.ArrayList;

import com.fanfanwang.ffw.app.R;
import com.fanfanwang.ffw.app.R.color;
import com.fanfanwang.ffw.app.bean.GlyMessageBean;
import com.fanfanwang.ffw.app.bean.SectionBean;
import com.fanfanwang.ffw.app.bean.ServiceBean;
import com.fanfanwang.ffw.app.bean.ServiceCarWashBean;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;


public class GlyMessageListAdapter extends BaseAdapter {

	private ArrayList<GlyMessageBean> beans;
	private Context mContext;
	public GlyMessageListAdapter(Context mContext,ArrayList<GlyMessageBean> beans) {
		// TODO Auto-generated constructor stub
		this.mContext = mContext;
		this.beans = beans;
	}
	public void resetData(ArrayList<GlyMessageBean> beans){
		this.beans=beans;
	}
	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return beans.size();
	}

	@Override
	public Object getItem(int position) {
		// TODO Auto-generated method stub
		return position;
	}

	@Override
	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		// TODO Auto-generated method stub
		final ViewHolder holder;
		if (convertView == null) {
			LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
			convertView = inflater.inflate(R.layout.item_for_messagelist, null);
			holder = new ViewHolder();
			holder.num = (TextView) convertView.findViewById(R.id.num);
			holder.date = (TextView) convertView.findViewById(R.id.yuyue_date);
			holder.nick = (TextView) convertView.findViewById(R.id.mess_nick_value);
			holder.car_num = (TextView) convertView.findViewById(R.id.mess_car_num_value);
			convertView.setTag(holder);
		}else {
			holder = (ViewHolder) convertView.getTag();
		}
		holder.num.setText((position+1)+"");
		return convertView;

	}

	class ViewHolder {
		TextView num;//表示排序的编号
		TextView date;//日期
		TextView nick;//昵称
		TextView car_num;//车牌号
	}


}
